#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
const int N = 1e5 + 10;
int a[N];
int n;
int main()
{
	int t;
	cin >> t;
	int k = 1;
	while (t--) {
		cin >> n;
		int h = 1;
		int idx1 = 1, idx2 = 0;
		for (int i = 1; i <= n; i++) {
			cin >> a[i];
			//ans = max(0, ans + a[i]);
		}
		int ans = 0;
		int ma = -2000;
		// -1 -1 -1
		for (int i = 1; i <= n; i++) {
			ans += a[i];
			if (ma < ans) {
				ma = ans;
				idx2 = i;
				idx1 = h;
			}
			if(ans < 0){
				ans = 0;
				h = i + 1;
			}
		}
		cout << "Case " << k++ << ":" << endl;
		cout << ma << " " << idx1 << " " << idx2 << endl;
		if (t != 0)cout << endl;
	}
	return 0;
}